package viper.receive;

import java.net.DatagramPacket;

import viper.main.ViperHeader;

public class UDPReceiverWorker implements Runnable {
	
	private DatagramPacket packet;

	public UDPReceiverWorker(DatagramPacket packet)
	{
		this.packet = packet;
	}
	
	@Override
	public void run() {
		//parse packet
		System.out.println("UDPWorker got packet");
		byte[] bytes = packet.getData();
		switch(bytes[0]) {
			case ViperHeader.RELAY: System.out.println("Relay"); break;
			case ViperHeader.RECEIVE: System.out.println("Receive"); break;
			case ViperHeader.CALL_SETUP: System.out.println("Call Setup"); break;
			default: System.out.println("ignore"); break;
		}
		           
	}

}
